package com.tensquare.advice;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.tensquare.entity.Result;

/**
 * Created by caoxingsheng.
 */
@RestControllerAdvice
public class RuntimeExceptionAdvice {

	@ExceptionHandler(value = { RuntimeException.class })
	public Result handlerAdException(RuntimeException e) {
		e.printStackTrace();
		return new Result(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage());
	}
}
